package org.concept.chinachesspieces.core;

public class Test {
	public static final byte[][] qj = { { 1, 2, 3, 4, 5, 4, 3, 2, 1 }, // 1
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 2
			{ 0, 6, 0, 0, 0, 0, 0, 6, 0 }, // 3
			{ 7, 0, 7, 0, 7, 0, 7, 0, 7 }, // 4
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 5
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 5
			{ 17, 0, 17, 0, 17, 0, 17, 0, 17 }, // 4
			{ 0, 16, 0, 0, 0, 0, 0, 16, 0 }, // 3
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 2
			{ 11, 12, 13, 14, 15, 14, 13, 12, 11 } // 1
	};

	/**
	 * 显示棋盘
	 * 
	 * @param bs
	 *            棋盘
	 */
	public static void display(byte[][] bs) {
		String[] str = { "十", "车", "马", "象", "士", "将", "炮", "兵" ,"","","","車","馬","相","士","帥","砲","卒"};
		System.out.println();
		for (int i = 0; i < bs.length; i++) {
			for (int j = 0; j < bs[i].length; j++) {
				System.out.print(str[bs[i][j]]);
			}
			System.out.println();
		}
	}

	public static void main(String[] args) {
		byte[][] qj = { { 00, 02, 03, 04, 05, 04, 03, 02, 01 }, // 1
				{ 00, 00, 00, 00, 00, 00, 00, 00, 00 }, // 2
				{ 00, 06, 00, 00, 00, 00, 00, 06, 00 }, // 3
				{ 07, 00, 07, 00, 07, 00, 07, 00, 07 }, // 4
				{ 00, 00, 07, 00, 00, 00, 00, 00, 00 }, // 5
				{ 00, 00, 00, 00, 00, 00, 00, 00, 00 }, // 5
				{ 17, 00, 17, 00, 00, 00, 17, 00, 17 }, // 4
				{ 00, 16, 00, 00, 00, 00, 00, 16, 00 }, // 3
				{ 00, 00, 00, 00, 00, 00, 00, 00, 00 }, // 2
				{ 11, 12, 13, 14, 15, 14, 13, 12, 11 } // 1
		};

		display(qj);
		System.out.println(ChessMap.legal(qj));
	}

}
